import Taro, { Component } from '@tarojs/taro'
import { View, Image } from '@tarojs/components'
import './companyList.less'


class CompanyList extends Component {

    componentWillReceiveProps(nextProps) {
        console.log(this.props, nextProps)
    }

    constructor(props) {
        super(props)
        this.state = {}
    }

    componentWillUnmount() { }

    componentDidShow() { }

    componentDidHide() { }

    toWhere(url, type, e) {
        Taro[type]({ url })
    }

    render() {
        let { companyList } = this.props
        return (
            <View className='companyList'>
                <View className='thingBlock'>
                    {
                        companyList.length > 0 && companyList.map((item, index) =>
                            <View className='thingLine' onClick={this.toWhere.bind(this, `/subPackages/subPackageS/brandInfo/brandInfo?company_id=${item.company_id}`, 'navigateTo')}>
                                <Image src={item.logo || 'https://file.open.banchengyun.com/353/b3e73f5f99544b2e368ed62be6dfcded'} mode='aspectFill' className='thingImg'></Image>
                                <View className='conItem'>
                                    <View className='thingTitle'>{item.title}</View>
                                    <View className='RowOne'>在招职位:{item.onlineJob}</View>
                                    <View className='RowSec'>{item.address}</View>
                                </View>
                            </View>
                        )
                    }
                </View>
            </View>
        )
    }
}

export default CompanyList
